Devid per client#406
Conversation
988d734 to
4ff72c1
Compare
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #406
Scan targets checked: none
Failed targets: wolfhsm-core-bugs, wolfhsm-crypto-bugs, wolfhsm-src
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #406
Scan targets checked: none
Failed targets: wolfhsm-core-bugs, wolfhsm-crypto-bugs, wolfhsm-src
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 47 out of 47 changed files in this pull request and generated 3 comments.
Comments suppressed due to low confidence (2)
wolfhsm/wh_client.h:1
- The docstring claims
wh_Client_SetDmaMode()can returnWH_ERROR_BADARGSon invalid input, but the implementation only errors onc == NULLand treats any non-zerouseDmaas enabled. Either (a) tighten the documentation to match current behavior (only NULL pointer is invalid), or (b) add explicit validation (e.g., only accept 0/1) so the documented error case is real.
wolfhsm/wh_keyid.h:1 - This comment describes
client_idas always constrained to[1, WH_CLIENT_ID_MAX](0 reserved), but then implies the server only rejects0whenWOLFHSM_CFG_GLOBAL_KEYSis enabled. Givenwh_Client_Init()now rejects0unconditionally, consider aligning the server-side contract/documentation by either (a) stating explicitly that the client library enforces0as invalid regardless of server config, or (b) updating the server INIT handling to reject0in all builds so the reserved namespace is consistently enforced end-to-end.
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #406
Scan targets checked: none
Failed targets: wolfhsm-core-bugs, wolfhsm-crypto-bugs, wolfhsm-src
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #406
Scan targets checked: wolfhsm-core-bugs, wolfhsm-crypto-bugs, wolfhsm-src
Findings: 1
1 finding(s) posted as inline comments (see file-level comments below)
This review was generated automatically by Fenrir. Findings are non-blocking.
c902d9f to
9ffec74
Compare
9ffec74 to
587b834
Compare
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #406
Scan targets checked: wolfhsm-core-bugs, wolfhsm-crypto-bugs, wolfhsm-src
No new issues found in the changed files. ✅
Overview:
This PR gives each client its own device ID, so you can run several clients in one process. You set a client's ID in its config (leave it 0 to get the default), and pass WH_CLIENT_DEVID(c) or the raw devId itself to wolfCrypt. The old shared IDs still work if you only have one client. DMA is now a simple per-client on/off switch instead of a separate device ID.
Changes: